package com.adteam.xmap.manager.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.adteam.xmap.entity.Campus;
import com.adteam.xmap.manager.CampusManager;

public class CampusManagerImpl extends HibernateDaoSupport implements CampusManager {

	public void addCampus(Campus campus) {

		getHibernateTemplate().save(campus);
	}

	public void delCampus(int id) {

		getHibernateTemplate().delete(findCampusById(id));
	}

	public List findAllCampuses() {

		return getHibernateTemplate().find("select c from Campus c");
	}

	public Campus findCampusById(int id) {

		return (Campus)getHibernateTemplate().load(Campus.class, id);
	}

	public void updateCampusg(Campus campus) {

		getHibernateTemplate().update(campus);
	}

}
